package com.cictec.middleware.core.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cictec.middleware.commons.utils.DateUtils;
import com.cictec.middleware.commons.utils.PMSUtils;
import com.cictec.middleware.core.entity.BusCharter;
import com.cictec.middleware.core.service.BusCharterService;

/**
 * 包车计划
 * 
 * @author Administrator
 *
 */
@RestController
public class BusCharterController {

	private static Logger logger = LoggerFactory.getLogger(BusCharterController.class);

	@Autowired
	private BusCharterService busCharterService;

	/**
	 * 【数据库】根据线路查询车辆(查询所属线路下所有车辆)
	 * 
	 * @param lineUuid
	 * @return
	 */
	@RequestMapping(value = "/dc/bus/busCharter")
	public List<BusCharter> getBusCharter(@RequestParam("busUuid") String busUuid,
			@RequestParam("date") String date) {

		logger.debug("获取包车计划");
		return busCharterService.selectBusCharterByParams(PMSUtils.isEmpty(busUuid)? null:busUuid, DateUtils.parseDate(date));

	}

}
